package cn.tedu.eguser1.base.response;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class jsonresoulte
{
    private Integer state;
    private String message;
    private Object data;

    public jsonresoulte(code code, Object data)
    {
        this.state = state;
        this.message = message;
        this.data = data;
    }
    public jsonresoulte(code code)
    {
        this.state = state;
        this.message = message;
        this.data = null;
    }
    public static jsonresoulte success()
    {
        return new jsonresoulte(code.SUCCESS);
    }
    public static jsonresoulte success(Object data)
    {
        return new jsonresoulte(code.SUCCESS, data);
    }
    public static jsonresoulte faild()
    {
        return new jsonresoulte(code.FAIL);
    }
    public static jsonresoulte faild(Object data)
    {
        return new jsonresoulte(code.FAIL, data);
    }
}
